package model;

import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;


public class Score {
	
	private int scoreP;
	private int scoreAI;
	private Game game;
	int height = 60;
	
	public Score(Game g) {
		this.game = g;
		scoreP = 0;
		scoreAI = 0;
	}
	
	public void draw(Graphics g) {
		Color saved = Color.WHITE;
		g.setColor(Color.WHITE);
		g.setFont(new Font("DialogInput", 20, 20));
		placeScoreP("" + scoreP, g, Game.WIDTH / 2 - 50);
		placeScoreAI("" + scoreAI, g, Game.WIDTH / 2 + 50);
		g.setColor(saved);
	}
	
	private void placeScoreAI(String s, Graphics g, int x) {
		g.drawString(s, x, height);
	}

	private void placeScoreP(String s, Graphics g, int x) {
		g.drawString(s, x, height);
	}
	
	public void update() {
		scoreP = game.getScoreP();
		scoreAI = game.getScoreAI();
	}
	
	public void addPointP() {
		scoreP += 1;
	}
	
	public void addPointAI() {
		scoreAI += 1;
	}
}
